Overview
The EDL Pipeline integrates with multiple Dhan ScanX API endpoints to fetch comprehensive market data. All endpoints usePOST method with JSON payloads unless specified otherwise.
Authentication & Headers
All Dhan API requests use standardized headers frompipeline_utils.py:
- Chrome on Windows 10
- Chrome on macOS
- Chrome on Linux
- Firefox on Windows
- Safari on macOS
Market Data Endpoints
Full Market Data
https://ow-scanx-analytics.dhan.co/customscan/fetchdtPOST
fetch_dhan_data.pydhan_data_response.json + master_isin_map.jsonArray of stock objects containing Symbol, Name, ISIN, Sid, Market Cap, Price, Volume, and other market metrics
Fundamental Data (Results & Ratios)
https://open-web-scanx.dhan.co/scanx/fundamentalPOST
fetch_fundamental_data.py30 seconds
fundamental_data.json (35 MB)“success” or “error”
Array containing quarterly results, EPS, sales, OPM, debt ratios, and ownership data
The pipeline batches requests in chunks of 100 ISINs with a 0.5-second delay between batches to be polite to the server.
Company Filings (Hybrid)
https://ow-static-scanx.dhan.co/staticscanx/company_filingshttps://ow-static-scanx.dhan.co/staticscanx/lodrPOST
fetch_company_filings.py20
10 seconds per endpoint
company_filings/{SYMBOL}_filings.jsonnews_id + news_date + caption.
Request Payload:
Array of filing objects with news_id, news_date, caption, descriptor, and file_url (PDF link)
Live Announcements
https://ow-static-scanx.dhan.co/staticscanx/announcementsPOST
fetch_new_announcements.py40
10 seconds
all_company_announcements.jsonArray of announcement objects with events, date, and type fields
Advanced Indicators (Pivot, EMA, SMA)
https://ow-static-scanx.dhan.co/staticscanx/indicatorPOST
fetch_advanced_indicators.py50
10 seconds
advanced_indicator_data.json (8.3 MB)Sid (Security ID) from master_isin_map.json.
Request Payload:
“NSE” for National Stock Exchange
“E” for Equity segment
Numeric Security ID (Sid) from master ISIN map
“D” for Daily timeframe
Contains EMA, SMA, Technical Indicators, and Pivot Point arrays
Market News Feed
https://news-live.dhan.co/v2/news/getLiveNewsPOST
fetch_market_news.py15
10 seconds
50 items per stock (max tested: 100)
market_news/{SYMBOL}_news.jsonPagination support (0-indexed)
Number of news items (tested up to 100)
Array of news objects with title, sentiment, publish date, and source
The endpoint returns 429 (rate limit) errors if overwhelmed. The script implements a 2-second backoff on rate limits.
Corporate Actions
https://ow-scanx-analytics.dhan.co/customscan/fetchdtPOST
fetch_corporate_actions.pyHistory (2 years back) + Upcoming (2 months ahead)
history_corporate_actions.json, upcoming_corporate_actions.jsonCircuit Stocks
https://ow-scanx-analytics.dhan.co/customscan/fetchdtfetch_circuit_stocks.py500
upper_circuit_stocks.json, lower_circuit_stocks.jsonBulk/Block Deals
https://ow-static-scanx.dhan.co/staticscanx/dealPOST
fetch_bulk_block_deals.py50 (auto-paginates all pages)
bulk_block_deals.jsonHistorical OHLCV
https://openweb-ticks.dhan.co/getDataHPOST
fetch_all_ohlcv.py15
15 seconds
215634600 (Oct 31, 1976 - forces maximum history)
“D” (Daily candles)
ohlcv_data/{SYMBOL}.csv“D” for Daily, “W” for Weekly, “M” for Monthly
Unix timestamp for start date (215634600 = Oct 31, 1976)
Unix timestamp for end date (current time)
Array of timestamps or date strings
Open prices
High prices
Low prices
Close prices
Volume
Standalone Endpoints (Not in Pipeline)
FNO Stocks
fetch_fno_data.pyFnoFlag=1, count: 500
fno_stocks_response.jsonFNO Lot Sizes
fetch_fno_lot_sizes.pydhan.co/nse-fno-lot-size/ (Next.js data)fno_lot_sizes_cleaned.jsonFNO Expiry Calendar
fetch_fno_expiry.pydhan.co/_next/data/{buildId}/fno-expiry-calendar.jsonfno_expiry_calendar.jsonAll Indices
fetch_all_indices.pycustomscan/fetchdt + Google Sheets Gviz fallbackall_indices_list.jsonETF Data
fetch_etf_data.pyETFFlag, count: 1000
etf_data_response.jsonBest Practices
Always include proper headers with User-Agent rotation to avoid detection.
Batch requests when possible (fundamental data supports 100 ISINs per call).
Add delays between batches (0.5s recommended) to be polite to servers.
Handle rate limits gracefully with exponential backoff on 429 errors.
Validate responses by checking status codes and response structure before parsing.